Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

The Actions columns in both report-table components used inline button definitions while property-worker-table uses a Material menu dropdown pattern. This inconsistency created a disjointed UX across tables.

Changes

Refactored two report-table components:

  1. modules/reports/components/report-table
  2. components/reports/report-table

TypeScript (report-table.component.ts)

  • Removed inline type: 'button' and buttons array from tableHeaders and adminTableHeaders
  • Added width: '160px' and pinned: 'right' to Actions column definition
  • Removed dynamic width calculation logic and dynamic class assignment logic

HTML (report-table.component.html)

  • Added cellTemplate binding for Actions column
  • Implemented actionsTpl with Material menu dropdown containing View images (conditional), Edit, and Delete actions
  • Used button IDs matching existing test patterns (actionMenu, viewImagesBtn-{{i}}, etc.)

Before:

{
  header: this.translateService.stream('Actions'),
  field: 'actions',
  type: 'button',
  buttons: [
    {
      tooltip: this.translateService.stream('View images'),
      type: 'icon',
      click: (record) => this.onClickViewPicture(record.microtingSdkCaseId),
      icon: 'image',
      iif: (record) => record.imagesCount !== 0,
    },
    // ... more buttons
  ]
}

After:

<ng-template #actionsTpl let-row let-i="index">
  <div class="report-actions" id="action-items-{{i}}">
    <button id="actionMenu" mat-icon-button [matMenuTriggerFor]="menu">
      <mat-icon>more_vert</mat-icon>
    </button>
    <mat-menu #menu="matMenu">
      <button mat-menu-item *ngIf="row.imagesCount !== 0" (click)="onClickViewPicture(row.microtingSdkCaseId)">
        <mat-icon>image</mat-icon>
        <span>{{ 'View images' | translate }}</span>
      </button>
      <!-- ... more menu items -->
    </mat-menu>
  </div>
</ng-template>

All functionality preserved, UI now consistent with other tables.

Files Modified

  • eform-client/src/app/plugins/modules/backend-configuration-pn/modules/reports/components/report-table/report-table.component.ts

  • eform-client/src/app/plugins/modules/backend-configuration-pn/modules/reports/components/report-table/report-table.component.html

  • eform-client/src/app/plugins/modules/backend-configuration-pn/components/reports/report-table/report-table.component.ts

  • eform-client/src/app/plugins/modules/backend-configuration-pn/components/reports/report-table/report-table.component.html

  • Fixes Change "Actions" to follow same style as all other tables #569

Original prompt

This section details on the original issue you should resolve

<issue_title>Change "Actions" to follow same style as all other tables</issue_title>
<issue_description>Use eform-client/src/app/plugins/modules/backend-configuration-pn/modules/property-workers/components/property-worker-table as implementation pattern to use.

The tables that needs to be refactored are these:

eform-client/src/app/plugins/modules/backend-configuration-pn/modules/reports/components/report-table

Also update wdio/cypress tests if needed</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Change actions table to match style of other tables Refactor report-table Actions column to use menu dropdown pattern Nov 7, 2025
Copilot finished work on behalf of renemadsen November 7, 2025 04:52
Copilot AI requested a review from renemadsen November 7, 2025 04:52
@renemadsen renemadsen marked this pull request as ready for review November 7, 2025 05:22
@renemadsen
Copy link
Member

@copilot now apply the same changes to this table:

eform-client/src/app/plugins/modules/backend-configuration-pn/components/reports/report-table

Copy link
Contributor Author

Copilot AI commented Nov 7, 2025

@copilot now apply the same changes to this table:

eform-client/src/app/plugins/modules/backend-configuration-pn/components/reports/report-table

Applied the same refactoring to eform-client/src/app/plugins/modules/backend-configuration-pn/components/reports/report-table. Changes include:

  • Replaced inline button definitions with menu dropdown pattern
  • Added width: '160px' and pinned: 'right' to Actions column
  • Created actionsTpl ng-template with Material menu containing View images (conditional), Edit, and Delete actions
  • Removed dynamic class assignment logic

Commit: 4271700

Copilot AI changed the title Refactor report-table Actions column to use menu dropdown pattern Refactor report-table Actions columns to use menu dropdown pattern Nov 7, 2025
Copilot finished work on behalf of renemadsen November 7, 2025 05:31
@renemadsen renemadsen merged commit 6a3c4e4 into master Nov 7, 2025
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change "Actions" to follow same style as all other tables

2 participants